/////////////////////////////////////////////////////////////////////
//
//  MOE Framework (Meta Object Encapsulation Framework)
//
//  Original Author: Wiksy Wang, 2011
//
/////////////////////////////////////////////////////////////////////

#ifndef MOE_PTR_POLICY_HPP
#define MOE_PTR_POLICY_HPP

#include <boost/shared_ptr.hpp>

namespace MOE
{

// Pointer assign policy using raw pointers.
template <class VT>
class RawPtrPolicy
{
public:
	typedef VT ValueType;
	typedef VT* RawType;
	typedef VT* Type;

	static Type Make(RawType rawPtr)
	{
		return rawPtr;
	}

	static RawType GetRaw(Type wrappedPtr)
	{
		return wrappedPtr;
	}

	template <class To>
	static typename RawPtrPolicy<To>::Type StaticCast(const Type& from)
	{
		return static_cast<To*>(from);
	}
};

/*
// Pointer assign policy using boost::shared_ptr smart pointers.

// TODO: In the current way the code is written, this policy is not supported.
// Put it back to work.

template <class VT>
class SharedPtrPolicy
{
public:
	typedef VT ValueType;
	typedef VT* RawType;
	typedef boost::shared_ptr<VT> Type;

	static Type Make(RawType rawPtr)
	{
		return PtrType(raw_ptr);
	}

	static RawType GetRaw(Type wrappedPtr)
	{
		return wrapped_ptr.get();
	}

	template <class To>
	static typename SharedPtrPolicy<To>::Type StaticCast(const Type& from)
	{
		return boost::static_pointer_cast<To>(from);
	}
};
*/

}

#endif
